package flyweight;

import java.util.HashMap;
import java.util.Map;

public class WebSiteFactory {

    private Map<String,ConcreteWebSite> map = new HashMap<>();


    public WebSite getWebSite(String type){
        return map.computeIfAbsent(type, key -> new ConcreteWebSite(type));
    }

    public int getWebSiteCount(){
        return map.size();
    }

}
